#!/bin/bash 

cd ..
make clean && make BUILDFLAG=TEST_AST
cd test
rm -rf *.out
for path in *
do
	N=`awk -v fn=$path 'BEGIN {print substr(fn,0,3)}'`
	O=${path/in/out}
	#if [ $N == "in" ] 
	if test $N == "in" || test $N == "in0";
	then
		echo testing $path ...
		../demo $path > $path.out && diff -u -w $path.out $O
	fi
done
